Skip to content

TST: lock down timeseries now tests, xref #18666 #18709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 12, 2017

Conversation

jbrockmendel
Copy link
Member

See the comment attached to test_to_datetime_today. This test is not deterministic, will fail to detect the change introduced by #18666 1 hour out of each day.

  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff

@codecov
Copy link

codecov bot commented Dec 10, 2017

Codecov Report

Merging #18709 into master will decrease coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18709      +/-   ##
==========================================
- Coverage    91.6%   91.56%   -0.05%     
==========================================
  Files         153      153              
  Lines       51273    51273              
==========================================
- Hits        46970    46947      -23     
- Misses       4303     4326      +23
Flag Coverage Δ
#multiple 89.42% <ø> (-0.03%) ⬇️
#single 40.68% <ø> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/plotting/_converter.py 64.78% <0%> (-1.74%) ⬇️
pandas/util/testing.py 81.82% <0%> (-0.2%) ⬇️
pandas/core/frame.py 97.81% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 34a8d36...75fadb8. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 10, 2017

Codecov Report

Merging #18709 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18709      +/-   ##
==========================================
- Coverage   91.61%   91.59%   -0.02%     
==========================================
  Files         153      153              
  Lines       51361    51361              
==========================================
- Hits        47053    47046       -7     
- Misses       4308     4315       +7
Flag Coverage Δ
#multiple 89.46% <ø> (ø) ⬆️
#single 40.73% <ø> (-0.12%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.81% <0%> (-0.1%) ⬇️
pandas/util/testing.py 82.53% <0%> (+0.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4091f64...af66e44. Read the comment docs.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments

@@ -211,7 +211,7 @@ def _test_parse_iso8601(object ts):
if ts == 'now':
return Timestamp.utcnow()
elif ts == 'today':
return Timestamp.utcnow().normalize()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

side issue, do we really need this actual test routine? can't we just inspect the actual output?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best guess is that this is intended to be double-sure that a test specifically hits string_to_dts (since coverage is hard with cython). I'd have no real objection to losing this function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i think ok to remove

npnow = np.datetime64('now').astype('datetime64[ns]')
pdnow = pd.to_datetime('now')
pdnow2 = pd.to_datetime(['now'])[0]
# These should all be equal with infinite perf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

give a little room, I have seen flakiness with these kinds of tests, maybe < 1e7 or something

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confused. You want more room or less room? 1e7 < 1e10.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm. you are comparing for 10s here. maybe add a comment.

nptoday = np.datetime64('today').astype('datetime64[ns]')
pdtoday = pd.to_datetime('today')
pdtoday2 = pd.to_datetime(['today'])[0]
# These should all be equal with infinite perf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same & add a blank line

@jreback jreback added Testing pandas testing functions or related to the test suite Datetime Datetime data dtype labels Dec 10, 2017
@jreback jreback added this to the 0.22.0 milestone Dec 10, 2017
@jreback jreback changed the title fix change in 18666, add tests TST: lock down timeseries now tests, xref #18666 Dec 10, 2017
@jreback
Copy link
Contributor

jreback commented Dec 11, 2017

failing on windows.

@jbrockmendel
Copy link
Member Author

Weird since only comment/whitespace change since last run. Error is in pandas.util.testing, may just have to skip on windows.

@jreback jreback merged commit 38c6fc8 into pandas-dev:master Dec 12, 2017
@jreback
Copy link
Contributor

jreback commented Dec 12, 2017

thanks!

@jbrockmendel jbrockmendel deleted the revert_today branch February 11, 2018 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants